
#ifndef INTERSECTION_INFO_LIST_H
#define INTERSECTION_INFO_LIST_H
#include "reducer_ptr.h"
#include "Line.h"
#include "IntersectionDetection.h"



class IntersectionInfoList {
  public:
    Line *l1;
    Line *l2;
    IntersectionInfoList* next;
    IntersectionInfoList* prev;
    IntersectionType intersectionType;
  // Used to construct an identity list.
    IntersectionInfoList() ;
  //desturctor TODO
    IntersectionInfoList(Line *l1, Line *l2, IntersectionType itype);
    void append(IntersectionInfoList* right);
};
class IIListMonoid : public cilk::monoid_base2<IntersectionInfoList> {
  public:
    static void reduce(IntersectionInfoList* left, IntersectionInfoList* right) {
      left->append(right) ;
    }
    // Construct an identity element.
    static void identity(IntersectionInfoList* p) {
      new ((void*) p) IntersectionInfoList();
    }
};
typedef cilk::reducer_ptr< IIListMonoid > IntersectionInfoList_append_reducer;
#endif // INTERSECTION_INFO_LIST
